﻿Public Class frmLoginUserList
    Dim dbBase As New dbUser
    Dim frmCtrl As New control
    Dim dsBase As DataSet
    Dim EntryID As String

    'Protected Overrides Sub SetVisibleCore(value As Boolean)

    'End Sub

    Private Sub frmLoginUserList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        frmCtrl.reDesign(Me)
        EntryID = ""
        UcGridFilter1.Enabled = True
        dsBase = dbBase.GetLoginUserList()
        UcHeader1.Iniliaze("LIST : Login User", Me, Nothing, UcGridFilter1.getDataGridView(), "usrGenID", True)
        UcGridFilter1.Initialize(dsBase.Tables(0), "usrGenID", UcHeader1, Me, True)
        If (dsBase IsNot Nothing) Then
            UcGridFilter1.getDataGridView().Columns("usrGenID").Visible = False
        End If
    End Sub

    Private Sub tsNew_Click(ByVal sender As Object) Handles UcHeader1.tsNewClick
        Dim OpenForm As New frmLoginUserManagement
        OpenForm.EntryID = ""
        frmCtrl.OpenFormDetail(Me, OpenForm)
    End Sub

    Private Sub GridCellEnter_Click(ByVal sender As ucGridFilter, KeyValue As String) Handles UcGridFilter1.GridCellEnter
        Dim dvFind As DataView = New DataView(dsBase.Tables(0))
        dvFind.RowFilter = "[usrGenID] = '" & KeyValue & "'"
        EntryID = dvFind.Item(0).Row("usrGenID").ToString()
    End Sub

    Private Sub GridDoubleClick_Click(ByVal sender As ucGridFilter) Handles UcGridFilter1.GridDoubleClick
        Dim OpenForm As New frmLoginUserManagement
        OpenForm.EntryID = EntryID
        frmCtrl.OpenFormDetail(Me, OpenForm)
    End Sub

    Private Sub tsEdit_Click(ByVal sender As Object) Handles UcHeader1.tsEditClick
        Dim OpenForm As New frmLoginUserManagement
        OpenForm.EntryID = EntryID
        frmCtrl.OpenFormDetail(Me, OpenForm)
    End Sub

    Private Sub tsPrint_Click(ByVal sender As Object) Handles UcHeader1.tsPrintClick
        ''Event 
        MessageBox.Show("Not included in prototype")
    End Sub

    Private Sub tsRefresh_Click(ByVal sender As Object) Handles UcHeader1.tsRefreshClick
        frmCtrl.openChild(New frmLoginUserList, Me.ParentForm)
    End Sub
End Class